/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/idenger">idenger</a> All rights reserved.
 */
package com.idenger.modules.edu.entity.user;

import com.idenger.common.persistence.DataEntity;
import com.idenger.common.utils.StringUtils;
import com.idenger.common.utils.excel.annotation.ExcelField;
import com.idenger.modules.edu.entity.order.EduOrder;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 用户Entity
 * @author 兰正军
 * @version 2017-12-01
 */
public class EduUser extends DataEntity<EduUser> {
	
	private static final long serialVersionUID = 1L;
	private String realName;		// 真实姓名
	private String sex;		// 性别
	private String age;		// 年龄
	private String phone;		// 电话
	private String userType;		// 用户类型
	private String image;		// 用户头像
	private String idCard;		// 身份证号码
	private String email;		// 邮箱
	private String password;		// password
	private String nickname;		// 昵称
	private Date birth;		// 生日
	private String introduce;		// 个人介绍
	private String openid;		// 微信OpenID
	private String loginName;		// 登录账号
	private String province;//省
	private String city;//市
	private String county;//区
	private String courseCount;//课程门数
	private Date createDate;
	
	private String account;		//登录时接收前台传递账号的字段，可能是loginName，可能是手机号身份证
	private String loginType;		//登录的类型，用什么登录的，0—手机号，1—身份证，2—用户名
	private String queryCriteria;		//查询条件
	private Date startDate;		//查询条件
	private Date endDate;		//查询条件
	
	
	
	
	//用户额外信息
	private String haveJobTitle;		// 是否拥有职称 
	private String jobTitleName;		// 职称名称
	private String jobTitleLevel;		// 职称等级（无、初级、中级、高级）
	private String educationLevel;		// 学历
	private String graduateCollege;		// 毕业院校
	private String major;		// 专业
	private String companyName;		// 工作单位名称
	private String companyNature;		// 单位性质
	private String isShanghaiFamilyRegister;		// 是否是上海户籍
	
	private List<EduOrder> list;
	
	public EduUser() {
		super();
	}

	public EduUser(String id){
		super(id);
	}
	
    @ExcelField(title="姓名(必填)", align=2, sort=10)
	@Length(min=0, max=64, message="真实姓名长度必须介于 0 和 64 之间")
	public String getRealName() {
		return realName;
	}
    public String getRealNameDisplay(){
    	if(StringUtils.isBlank(realName)){
    		realName = "暂无";
    	}
    	return realName;
    }

	public void setRealName(String realName) {
		this.realName = realName;
	}
    @ExcelField(title="性别", align=2, sort=50)  
	@Length(min=0, max=64, message="性别长度必须介于 0 和 64 之间")
	public String getSex() {
    	return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}
	@Length(min=0, max=11, message="年龄长度必须介于 0 和 11 之间")
	public String getAge() {
		return age;
	}

	public void setAge(String age) {
		this.age = age;
	}
    @ExcelField(title="手机号(必填)", align=2, sort=30)  
	@Length(min=0, max=11, message="电话长度必须介于 0 和 11 之间")
	public String getPhone() {
		return phone;
	}
    public String getPhoneDisplay(){
    	if(StringUtils.isBlank(phone)){
    		phone="暂无";
    	}
    	return phone;
    }

	public void setPhone(String phone) {
		this.phone = phone;
	}
	
	@Length(min=0, max=6, message="用户类型长度必须介于 0 和 6 之间")
	public String getUserType() {
		return userType;
	}

	public void setUserType(String userType) {
		this.userType = userType;
	}
	
	@Length(min=0, max=512, message="用户头像长度必须介于 0 和 512 之间")
	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}
    @ExcelField(title="身份证号码(必填)", align=2, sort=20)  
	@Length(min=0, max=18, message="身份证号码长度必须介于 0 和 18 之间")
	public String getIdCard() {
		return idCard;
	}

	public void setIdCard(String idCard) {
		this.idCard = idCard;
	}
    @ExcelField(title="邮箱", align=2, sort=40)  
	@Length(min=0, max=64, message="邮箱长度必须介于 0 和 64 之间")
	public String getEmail() {
		return email;
	}
    public String getEmailDisplay(){
    	if(StringUtils.isBlank(email)){
    		email="暂无";
    	}
    	return email;
    }

	public void setEmail(String email) {
		this.email = email;
	}
	
	@Length(min=0, max=64, message="password长度必须介于 0 和 64 之间")
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}
	
	@Length(min=0, max=64, message="昵称长度必须介于 0 和 64 之间")
	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}
	@JsonFormat(pattern = "yyyy-MM-dd")
	public Date getBirth() {
		return birth;
	}

	public void setBirth(Date birth) {
		this.birth = birth;
	}

	public String getIntroduce() {
		return introduce;
	}

	public void setIntroduce(String introduce) {
		this.introduce = introduce;
	}
	
	
	@Length(min=0, max=64, message="微信OpenID长度必须介于 0 和 64 之间")
	public String getOpenid() {
		return openid;
	}

	public void setOpenid(String openid) {
		this.openid = openid;
	}
	
	@Length(min=0, max=15, message="登录账号长度必须介于 0 和 15 之间")
	public String getLoginName() {
		return loginName;
	}
	
	public String getLoginNameDisplay(){
		if(StringUtils.isBlank(loginName)){
			loginName="暂无";
		}
		return loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	public String getAccount() {
		return account;
	}

	public void setAccount(String account) {
		this.account = account;
	}

	public String getLoginType() {
		return loginType;
	}

	public void setLoginType(String loginType) {
		this.loginType = loginType;
	}

	public String getQueryCriteria() {
		return queryCriteria;
	}

	public void setQueryCriteria(String queryCriteria) {
		this.queryCriteria = queryCriteria;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	
    @ExcelField(title="是否拥有职称", align=2, sort=70)  
	public String getHaveJobTitle() {
		return haveJobTitle;
	}

	public void setHaveJobTitle(String haveJobTitle) {
		this.haveJobTitle = haveJobTitle;
	}
    @ExcelField(title="职称名称", align=2, sort=80)  
	public String getJobTitleName() {
		return jobTitleName;
	}

	public void setJobTitleName(String jobTitleName) {
		this.jobTitleName = jobTitleName;
	}
	 @ExcelField(title="职称等级", align=2, sort=90)
	public String getJobTitleLevel() {
		return jobTitleLevel;
	}

	public void setJobTitleLevel(String jobTitleLevel) {
		this.jobTitleLevel = jobTitleLevel;
	}
	@ExcelField(title="学历", align=2, sort=100)
	public String getEducationLevel() {
		return educationLevel;
	}

	public void setEducationLevel(String educationLevel) {
		this.educationLevel = educationLevel;
	}
	@ExcelField(title="毕业院校", align=2, sort=110)
	public String getGraduateCollege() {
		return graduateCollege;
	}

	public void setGraduateCollege(String graduateCollege) {
		this.graduateCollege = graduateCollege;
	}
	@ExcelField(title="所学专业", align=2, sort=120)
	public String getMajor() {
		return major;
	}

	public void setMajor(String major) {
		this.major = major;
	}
	@ExcelField(title="工作单位", align=2, sort=130)
	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}
	@ExcelField(title="单位性质", align=2, sort=140)
	public String getCompanyNature() {
		return companyNature;
	}

	public void setCompanyNature(String companyNature) {
		this.companyNature = companyNature;
	}
	@ExcelField(title="是否是上海户籍", align=2, sort=150)
	public String getIsShanghaiFamilyRegister() {
		return isShanghaiFamilyRegister;
	}

	public void setIsShanghaiFamilyRegister(String isShanghaiFamilyRegister) {
		this.isShanghaiFamilyRegister = isShanghaiFamilyRegister;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getCounty() {
		return county;
	}

	public void setCounty(String county) {
		this.county = county;
	}

	public List<EduOrder> getList() {
		return list;
	}

	public void setList(List<EduOrder> list) {
		this.list = list;
	}
	
	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String getCourseCount() {
		return courseCount;
	}

	public void setCourseCount(String courseCount) {
		this.courseCount = courseCount;
	}

	
	
	
	
}